package com.liy.cloud.common.monitor.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.liy.cloud.common.monitor.dao.JkStationFlowDao;
import com.liy.cloud.common.monitor.entity.JkStationFlow;
import com.liy.cloud.common.monitor.service.JkStationFlowService;
import com.das.framework.common.dao.IBaseDao;
import com.das.framework.common.service.impl.BaseServiceImpl;
import com.das.framework.common.utils.DateUtil;

/**
 * 车站客流信息表 Service接口服务实现
 * 
 * @ClassName: JkStationFlowServiceImpl
 * @Description:
 * @author shitou
 * @date: 2018-07-04 18:30:14
 */
@Service
public class JkStationFlowServiceImpl extends BaseServiceImpl<JkStationFlow, String> implements JkStationFlowService {

	@Autowired
	private JkStationFlowDao jkstationflowDao;

	@Override
	public IBaseDao<JkStationFlow, String> getDao() {
		return jkstationflowDao;
	}

	@Override
	public void insertCountData(String preTime, String curTime) {

		jkstationflowDao.inserCountData(preTime, curTime);
	}
	
	@Override
	public String findPreCountRow() {
		
		JkStationFlow flow = jkstationflowDao.selectPreCountRow();
		if(flow == null) {
			return DateUtil.getDayDateString(-30, "yyyyMMdd000000");	//默认前30天日期
		}
		
		return flow.getFlowTime();
	}

	@Override
	public List<JkStationFlow> findRealTimeMinute1(JkStationFlow flow, List<String> timeList) {
		return jkstationflowDao.selectRealTimeMinute1(flow, timeList);
	}
	
	@Override
	public List<JkStationFlow> findRealTimeForLike(JkStationFlow flow, List<String> timeList) {
		return jkstationflowDao.selectRealTimeForLike(flow, timeList);
	}

	@Override
	public List<JkStationFlow> findRealTimeForRange(JkStationFlow flow, List<Map<String, String>> timeList) {
		return jkstationflowDao.selectRealTimeForRange(flow, timeList);
	}

}